package com.shijun.im.activity.interactor;

import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;

import java.util.Map;

/**
 * Created by zhushijun on 2017/10/17 0017.
 */

public interface RegistInteractor {

    public static final int REGIST_PASSWORDERROR = 10001;
    public static final int REGIST_USERNAMEERROR = 10002;
    public static final int REGIST_PASSWORDCOMMITERROR = 10003;
    public static final int REGIST_PHONEERROR = 10004;
    public static final int REGIST_ADDRESSERROR = 10005;
    public static final int REGIST_EMAILERROR = 10006;


    void registInput(Map<String,String> userInfo, OnRegistInputListener listener);

    void registCommit(Context context,Map<String, String> userInfo, OnRegistFinishedListener listener);

    //上传头像
    void upLoadingAvatar();

    //裁剪图片
    void cropRawPhoto(Uri uri, int output_X, int output_Y);

    //选取本地相册图片
    void getLocationImage();

    //选取本地相册图片
    void takePhoto();

    //提取保存裁剪之后的图片数据，并更新头像部分的View
    void setImageToHeadView(Uri uri,OnAvatarListener listener);

    //判断是否有sd卡
    boolean hasSdcard();

    //获取图片缓存uri
    Uri getTempUri();

    interface OnRegistInputListener {
        void onInputError(int key,String info);

        void onInputSuccess();
    }

    interface OnRegistFinishedListener {
        void onRegistError();

        void onRegistSuccess();
    }

    interface  OnAvatarListener{
        void onShowAvatar(Bitmap bitmap);

        void onUpLoadAvatarComplete();
    }


}
